// admin-model.js - A mongoose model
//
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.

module.exports = function (app) {
  const mongooseClient = app.get('mongooseClient')
  const { Schema } = mongooseClient
  const admin = new Schema({
    username: { type: String, unique: true },
    password: { type: String },
    mobile: { type: String },
    mail: { type: String},
    role: { type: Schema.Types.ObjectId },
    status: { type: Number, default: 0 },
    last: {
      login: { type: Date },
      ip: { type: String }
    },
    del: { type: Boolean, default: false }
  })


  return mongooseClient.model('admin', admin)
}
